import cv2
import numpy as np


img = cv2.imread("test1.jpg", cv2.IMREAD_UNCHANGED)
print('img:',type(img))
data = img.data
print(type(img))
print(data.shape)
cv2.imshow('original', img)

new_img = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
print(new_img.shape)
cv2.imshow('RGB2Gray',new_img)

new_img = cv2.cvtColor(new_img, cv2.COLOR_GRAY2BGRA)
print(new_img.shape)
cv2.imshow('Gray2RGB',new_img)

def test():
    print(__file__)

test()
'''
new_img = cv2.cvtColor(im, cv2.COLOR_RGB2BGR)
cv2.imshow('BGR',new_img)

new_img = cv2.cvtColor(im, cv2.COLOR_BGR2HSV)
cv2.imshow('BGR2HSV',new_img)

new_img = cv2.cvtColor(im, cv2.COLOR_RGB2GRAY)
cv2.imshow('Gray',new_img)
'''

cv2.waitKey(0)
cv2.destroyAllWindows()
